package com.ruoyi.labdata.domain;

import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;

/**
 * 流程节点对象 lab_flow_node
 * 
 * @author winner pan
 * @date 2022-03-06
 */
public class LabFlowNode extends BaseEntity
{
    private static final long serialVersionUID = 1L;

    /** 节点ID */
    private Long nodeId;

	/** 流程ID */
    @Excel(name = "流程ID")
    private Long workflowId;

    /** 节点名称 */
    @Excel(name = "节点名称")
    private String nodeName;

    /** 节点类型 */
    @Excel(name = "节点类型")
    private String nodeTypeOpt;

    /** 签批类型 */
    @Excel(name = "签批类型")
    private String approvalTypeOpt;

    /** 签批角色 */
    @Excel(name = "签批角色")
    private String approvalRoles;
    
    private String approvalRolesName;
    
    private Boolean passed;
    
    private Boolean refused;
    
    private Boolean rectify;
    
    
    public Boolean getPassed() {
		return passed;
	}

	public void setPassed(Boolean passed) {
		this.passed = passed;
	}

	public Boolean getRefused() {
		return refused;
	}

	public void setRefused(Boolean refused) {
		this.refused = refused;
	}

	public Boolean getRectify() {
		return rectify;
	}

	public void setRectify(Boolean rectify) {
		this.rectify = rectify;
	}

	public String getApprovalRolesName() {
		return approvalRolesName;
	}

	public void setApprovalRolesName(String approvalRolesName) {
		this.approvalRolesName = approvalRolesName;
	}

	private Long[] roleIds;
    

    public Long[] getRoleIds() {
		return roleIds;
	}

	public void setRoleIds(Long[] roleIds) {
		this.roleIds = roleIds;
		if(this.roleIds!=null && roleIds.length>0){
			StringBuffer buf = new StringBuffer(roleIds[0].toString());
			for(int i=1;i<roleIds.length;i++){
				buf.append(",").append(roleIds[i]);
			}
			this.approvalRoles = buf.toString();
		}
	}

	/** 节点状态 */
    @Excel(name = "节点状态")
    private String statusOpt;

    /** 节点排序 */
    @Excel(name = "节点排序")
    private Integer nodeNo;

    public void setNodeId(Long nodeId) 
    {
        this.nodeId = nodeId;
    }

    public Long getNodeId() 
    {
        return nodeId;
    }
    public void setWorkflowId(Long workflowId) 
    {
        this.workflowId = workflowId;
    }

    public Long getWorkflowId() 
    {
        return workflowId;
    }
    public void setNodeName(String nodeName) 
    {
        this.nodeName = nodeName;
    }

    public String getNodeName() 
    {
        return nodeName;
    }
    public void setNodeTypeOpt(String nodeTypeOpt) 
    {
        this.nodeTypeOpt = nodeTypeOpt;
    }

    public String getNodeTypeOpt() 
    {
        return nodeTypeOpt;
    }
    public void setApprovalTypeOpt(String approvalTypeOpt) 
    {
        this.approvalTypeOpt = approvalTypeOpt;
    }

    public String getApprovalTypeOpt() 
    {
        return approvalTypeOpt;
    }
    public void setApprovalRoles(String approvalRoles) 
    {
        
    	this.approvalRoles = approvalRoles;
		if(approvalRoles!=null && this.roleIds==null){
		   String[] arr = approvalRoles.split(",");
		   this.roleIds = new Long[arr.length];
		   for(int i =0 ; i < arr.length; i++){
			   this.roleIds[i] = Long.valueOf(arr[i]);
		   }
		}
    }

    public String getApprovalRoles() 
    {
        return approvalRoles;
    }
    public void setStatusOpt(String statusOpt) 
    {
        this.statusOpt = statusOpt;
    }

    public String getStatusOpt() 
    {
        return statusOpt;
    }
    public void setNodeNo(Integer nodeNo) 
    {
        this.nodeNo = nodeNo;
    }

    public Integer getNodeNo() 
    {
        return nodeNo;
    }

    @Override
    public String toString() {
        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
            .append("nodeId", getNodeId())
            .append("workflowId", getWorkflowId())
            .append("nodeName", getNodeName())
            .append("nodeTypeOpt", getNodeTypeOpt())
            .append("approvalTypeOpt", getApprovalTypeOpt())
            .append("approvalRoles", getApprovalRoles())
            .append("statusOpt", getStatusOpt())
            .append("nodeNo", getNodeNo())
            .toString();
    }
}
